package com.zzw.zim.system.controller;


import com.zzw.zim.common.utils.Result;
import com.zzw.zim.system.dto.SysUserDTO;
import com.zzw.zim.system.service.SysUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 用户管理
 *
 * @author XiaoJie
 * @email
 * @date 2025-05-13 09:43:17
 */
@Tag(name = "用户管理")
@RestController
@RequestMapping("system/user")
public class SysUserController {

    @Resource
    private SysUserService userService;

    @PostMapping("add")
    @Operation(summary = "新增用户")
    public Result<Boolean> addUser (@RequestBody SysUserDTO userDTO) {
        return Result.ok(userService.addUser(userDTO));
	}

    @PostMapping("remove/{userId}")
    @Operation(summary = "删除用户")
    public Result<Boolean> removeUser (@PathVariable("userId") String userId) {
        return Result.ok(userService.removeUser(userId));
    }

}
